/**
 * 标签相关类型定义
 */

/**
 * 标签接口定义
 */
export interface Tag {
  id: string;
  name: string;
  description?: string;
  color?: string;
  icon?: string;
  createdAt: string;
  updatedAt: string;
}

/**
 * 创建标签请求接口
 */
export interface CreateTagRequest {
  name: string;
  color?: string;
  description?: string;
}

/**
 * 更新标签请求接口
 */
export interface UpdateTagRequest {
  name?: string;
  color?: string;
  description?: string;
}

/**
 * 标签数据文件结构
 * 用于JSON文件存储的完整数据结构
 */
export interface TagDataFile {
  tags: Tag[];
  metadata: {
    version: string;
    lastUpdated: string;
    totalCount: number;
  };
}

/**
 * 标签数据结构（兼容性别名）
 */
export type TagsData = TagDataFile;

/**
 * 标签校验规则
 */
export const tagValidationSchema = {
  name: {
    required: true,
    type: 'string',
    minLength: 1,
    maxLength: 50
  },
  color: {
    required: false,
    type: 'string',
    pattern: /^#[0-9A-Fa-f]{6}$/
  },
  description: {
    required: false,
    type: 'string',
    maxLength: 200
  }
};